function [yhat val] = SSVM_LossAumentedInference(w, x, y, K)
  %fprintf('constraintCB x=[%d %d],y=%d\n',x,y);
% slack resaling: argmax_y delta(yi, y) (1 + <psi(x,y), w> - <psi(x,yi), w>)
% margin rescaling: argmax_y delta(yi, y) + <psi(x,y), w>
valuetable=zeros(K,2);
    for i =1:K
        valuetable(i) = w'*SSVM_feature(x,i,K) + SSVM_Loss(y,i);
    end
    
  [Val Ith]=sort(valuetable,'descend');
  yhat = Ith(1);
  val = Val(1);
end

